/*
 * ========================================================================
 *
 *       Filename:  statinfo.cpp
 *
 *    Description:  This implements the class defined in statinfo.h.
 *
 *        Version:  1.0
 *        Created:  05/10/2010 09:42:24 AM
 *       Revision:  none
 *       Compiler:  g++
 *
 *         Author:  Alex Avance (aa), aravance@gmail.com
 *        Company:  independent
 *
 * ========================================================================
 *
 * Copyright (C) 2010 Alex Avance
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-
 * 1307, USA.
 *
 * ========================================================================
 */
#include "statinfo.h"

/**************************************************************************
Class Name: StatInfo
Method Name: StatInfo
Description: constructor
**************************************************************************/
StatInfo::StatInfo ()
  : m_Right( 0 ), m_Wrong( 0 )
{} // ----- end of method StatInfo::StatInfo (constructor) -----

/**************************************************************************
Class Name: StatInfo
Method Name: StatInfo
Description: copy constructor
**************************************************************************/
StatInfo::StatInfo ( const StatInfo &other )
  : m_Right( other.m_Right ), m_Wrong( other.m_Wrong )
{} // ----- end of method StatInfo::StatInfo (copy constructor) -----

/**************************************************************************
Class Name: StatInfo
Method Name: StatInfo
Description: constructor
**************************************************************************/
StatInfo::StatInfo ( const StatT &front, const StatT &back )
  : m_Right( front ), m_Wrong( back )
{} // ----- end of method StatInfo::StatInfo (constructor) -----

/**************************************************************************
Class Name: StatInfo
Method Name: StatInfo
Description: destructor
**************************************************************************/
StatInfo::~StatInfo ()
{} // ----- end of method StatInfo::StatInfo (destructor) -----

/**************************************************************************
Class: StatInfo
Method: Right
Description: Return the number of correct guesses.
**************************************************************************/
StatInfo::StatT StatInfo::Right () const
{ return m_Right; } // ----- end of method StatInfo::Right -----

/**************************************************************************
Class: StatInfo
Method: Wrong
Description: Return the number of incorrect guesses.
**************************************************************************/
StatInfo::StatT StatInfo::Wrong () const
{ return m_Wrong; } // ----- end of method StatInfo::Wrong -----

/**************************************************************************
Class: StatInfo
Method: Guess
Description: Increment the appropriate counter based on a given result.
**************************************************************************/
void StatInfo::Guess ( bool result )
{
  if ( result )
    ++m_Right;
  else
    ++m_Wrong;
} // ----- end of method StatInfo::Guess -----

/**************************************************************************
Class: StatInfo
Method: ResetStats
Description: Set both counters back to 0.
**************************************************************************/
void StatInfo::ResetStats ()
{
  m_Right= 0;
  m_Wrong= 0;
} // ----- end of method StatInfo::ResetStats -----

/**************************************************************************
Class Name: StatInfo
Method Name: operator=
Description: assignment operator
**************************************************************************/
StatInfo& StatInfo::operator= ( const StatInfo &other )
{
  if ( this != &other )
  {
    m_Right= other.m_Right;
    m_Wrong= other.m_Wrong;
  }
  return *this;
} // ----- end of method StatInfo::operator= (assignment operator) -----

